#!/bin/bash

if [ $# -lt 2 ]; then
    echo "$0 <pkg> <revision>"
    exit 1
fi

p=$1
r=$2

pushd $p
osc up
sed -i "/name=\"revision\"/s|>.*<|>$r<|" _service
popd
osc ci ${p} -m "$p: $r source"
